<?php


// multiprocesses

function fork()
{
	$pid = pcntl_fork();
	if ($pid === -1) {
		// Error
		echo 'Process could not be forked';
	} else if ($pid) {
		// Parent
		echo 'pid of the child process:'.$pid."\n";
	} else {
		// Child
		sleep(30);
	}
}


/**
 *
 * file processing
 */

fclose(STDIN);
fclose(STDOUT);
fclose(STDERR);
       
 $STDIN = fopen($options["logLocation"], "r");
 global $STDOUT;global $STDERR;
 $STDERR = $STDOUT = fopen($options["logLocation"], "a+");


set_error_handler(array('System_Daemon', 'phpErrors'), E_ALL); 
